#ifndef __GL_COMPONENT
#define __GL_COMPONENT

//#define PI 3.14159
#define TWO_PI PI*2.0
#define HALF_PI PI/2.0
#include "camera.h"
// remove above definition of PI - already defined in vector.h

#include "world.h"
// remove above definition of PI - already defined in vector.h

class OGLWindow
{
private:
	int m_windowWidth;
	int m_windowHeight;
	
	float m_angle;

	CCamera *gameCamera;
	CCamera *OnGetCamera() { return gameCamera; }
	CWorld *gameWorld;
	CWorld *OnGetWorld() { return gameWorld; }


public:
	OGLWindow();
	virtual ~OGLWindow();
	
	//changes view angle for sniper and regular view
	float viewAngle;
	

	bool Init();
	bool Shutdown();

	void SetupProjection(int width, int height);
	void Prepare();
	void Render(float deltaTime);

	int mouseX;
	int mouseY;
	float mouseSensitivity;

	int GetMouseX(LPARAM lParam);		// get true mouse coordinates
	int GetMouseY(LPARAM lParam);
	void OnMouseMove(int x, int y);

	void OnKeyDown(int nVirtKey);
	void OnKeyUp(int nVirtKey);

	void OnMouseDownL(int x, int y);
	

public:
	int getWidth() const;
	int getHeight() const;
	

private:
	bool keys[256];
};

#endif